import request from '@/content/utils/request'
// 用户登录
const login = (data) => {
    return request({
        url: '/user/login',
        method: 'post',
        data,
    })
}

// 用户注册
const register = (data) => {
    return request({
        url: '/user/registerUser',
        method: 'post',
        data,
    })
}

// 注册获取短信验证码
const pushShortMessage = (data) => {
    return request({
        url: '/user/pushShortMessage',
        method: 'post',
        data,
    })
}

// 找回密码
const forgetPassword = (data) => {
    return request({
        url: '/user/forgetPassword',
        method: 'post',
        data,
    })
}
// 获取用户信息
const getUserInfo = (data = {}) => {
    return request({
        url: '/user/getUserById',
        method: 'post',
        data,
    })
}

// 微信扫码获取用户信息
const getQrUserInfo = (data = {}) => {
    return request({
        url: '/wechat/getQrUserInfo',
        method: 'post',
        data,
    })
}

//获得微信qr_uuid
const getQrUuid = (data) => {
    return request({
        url: '/wechat/postQrUuid',
        method: 'post',
        data,
    })
}

// 完善用户信息
const perfectUserInfo = (data) => {
    return request({
        url: '/user/perfectUserInfo',
        method: 'post',
        data,
    })
}

/**
 * 获取登录页面背景图
 */
const getAppBackImg = (data) => {
    return request({
        url: '/app/getAppBackImg',
        method: 'post',
        data
    })
}

//
const updateUseTime = (data) => {
    return request({
        url: '/user/updateUseTime',
        method: 'post',
        data,
    })
}
//更新用户信息
const updateUser = data => {
    return request({
        url: '/user/updateUser',
        method: 'post',
        data,
    })
}

const createUserVersion = (data) => {
    return request({
      url: '/app/createUserVersion',
      method: 'post',
      data,
    })
  }

const switchToken = (data) => {
    return request({
        url: '/user/switchToken',
        method: 'post',
        data
    })
}

const tick = () => {
    return request({
        url: '/tick',
        method: 'get'
    })
}
const loginOut = (data) => {
    return request({
        url: 'user/loginOut',
        method: 'post',
        data
    })
}
const authRedeemCode = data => {
    return request({
        url: 'redeem/authRedeemCode',
        method: 'post',
        data
    })
}

const updateOfflineTime = (data) => {
    return request({
        url: '/user/updateOfflineTime',
        method: 'post',
        data
    })
}

const custormerFeedback = data => {
    return request({
        url: '/feedback/createFeedBacks',
        method: 'post',
        data
    })
}

const getCustormerFeedbackNums = data => {
    return request({
        url: '/feedback/getAllFeedBacksByUserId',
        method: 'post',
        data
    })
}

const getAllPostMessage = (data = {}) => {
    return request({
        url: '/feedback/getAllMessage',
        method: 'post',
        data
    })
}

const changeMessageStatus = (data) => {
    return request({
        url: 'feedback/readOneMessage',
        method: 'post',
        data
    })
}

const perfectUserOS = (data) => {
    return request({
        url: '/user/perfectUserOS',
        method: 'post',
        data
    })
}

const recordUserClass = (data) => {
    return request({
        url: '/user/recordUserClass',
        method: 'post',
        data
    })
}

const createScreenShotRecord = data => {
    return request({
        url: '/portal/usermeta/createScreenShotRecord',
        method: 'post',
        data
    })
}
const getWebAccessToken = data => {
    return request({
        url: '/user/getWebAccessToken',
        method: 'post',
        data
    })
}
export default {
    createScreenShotRecord,
    login,
    register,
    pushShortMessage,
    forgetPassword,
    getAppBackImg,
    getUserInfo,
    getQrUserInfo,
    getQrUuid,
    perfectUserInfo,
    updateUseTime,
    switchToken,
    tick,
    updateUser,
    createUserVersion,
    loginOut,
    authRedeemCode,
    updateOfflineTime,
    custormerFeedback,
    getCustormerFeedbackNums,
    getAllPostMessage,
    changeMessageStatus,
    perfectUserOS,
    recordUserClass,
    getWebAccessToken,
}